<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         function fn1(){
             return new Promise(resolve=>{
                setTimeout(() => {
                    console.log("fn1");
                    resolve();
                }, 1000);
             })
           
        }

        function fn2(){
            return new Promise(resolve=>{
                setTimeout(() => {
                    console.log("fn2");
                    resolve();
                }, 1000);
             })
        }

        function fn3(){
            return new Promise(resolve=>{
                setTimeout(() => {
                    console.log("fn3");
                    resolve();
                }, 1000);
             })
        }
        fn1().then(()=>{
            console.log('fn1执行完毕');
            return fn2()
        }).then(()=>{
            console.log('fn2执行完毕');
            return fn3();
        }).then(()=>{
            console.log('fn3执行完毕')
        })
    </script>
</body>
</html>